﻿Public Class Frm_Columns

    Private Sub Frm_Columns_FormClosed(ByVal sender As Object, ByVal e As System.Windows.Forms.FormClosedEventArgs) Handles Me.FormClosed
        Try
        Partager.tabColumns = Nothing

        Dim i As Integer = 0
        For Each check As CheckBox In Me.Controls
            If check.Checked = True Then
                ReDim Preserve Partager.tabColumns(i)
                Partager.tabColumns(i) = check.Text
                i += 1
            End If
        Next
            Frm_a7kame.Enabled = True
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub

    Private Sub Frm_Columns_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
        Try
            If Not IsNothing(Partager.tabColumns) Then
                For i As Integer = 0 To Partager.tabColumns.Count - 1
                    If Partager.tabColumns(i) = "المحكمة" Then
                        Check_tribunal.Checked = True
                    End If
                    If Partager.tabColumns(i) = "رقم الملف" Then
                        Check_Num_Dossier.Checked = True
                    End If
                    If Partager.tabColumns(i) = "المقــرر" Then
                        Check_mo9arir.Checked = True
                    End If
                    If Partager.tabColumns(i) = "الموكـل" Then
                        Check_client.Checked = True
                    End If
                    If Partager.tabColumns(i) = "الخصـم" Then
                        Check_advr.Checked = True
                    End If
                    If Partager.tabColumns(i) = "محامي الخصم" Then
                        Check_avocaAdv.Checked = True
                    End If
                    If Partager.tabColumns(i) = "تاريخ آخر جلسة" Then
                        Check_datijraa.Checked = True
                    End If
                    If Partager.tabColumns(i) = "السبب" Then
                        Check_cause.Checked = True
                    End If
                    If Partager.tabColumns(i) = "الحكم أو القرار" Then
                        Check_dicision.Checked = True
                    End If
                    If Partager.tabColumns(i) = "تاريخ الحكم أو القرار" Then
                        Check_datdicision.Checked = True
                    End If
                Next
            Else
                Check_tribunal.Checked = True
                Check_Num_Dossier.Checked = True
                Check_mo9arir.Checked = True
                Check_client.Checked = True
                Check_advr.Checked = True
                Check_avocaAdv.Checked = True
                Check_datijraa.Checked = True
                Check_cause.Checked = True
                Check_dicision.Checked = True
                Check_datdicision.Checked = True
            End If
       
        Catch ex As Exception
            MsgBox(ex.Message)
        End Try
    End Sub
End Class